//
//  BTCCommonSellViewController.m
//  project
//
//  Created by 张亚林 on 2017/10/28.
//  Copyright © 2017年 Macmini. All rights reserved.
//

#import "BTCCommonSellViewController.h"

#import "UIBarButtonItem+Item.h"
#import <MJExtension.h>

@interface BTCCommonSellViewController ()<UITableViewDelegate, UITableViewDataSource>

@property (weak, nonatomic) IBOutlet UIView *fudongView;
@property (weak, nonatomic) IBOutlet NSLayoutConstraint *topCon;
@property (weak, nonatomic) IBOutlet NSLayoutConstraint *heightCon;
@property (nonatomic, assign)BOOL isSec;
@property (weak, nonatomic) IBOutlet NSLayoutConstraint *timeViewHeight;
@property (weak, nonatomic) IBOutlet NSLayoutConstraint *liuyanViewTop;

@property (weak, nonatomic) IBOutlet NSLayoutConstraint *midderVIewHeight;

@property (weak, nonatomic) IBOutlet UITableView *tableview;
@property (weak, nonatomic) IBOutlet NSLayoutConstraint *PaymentViewHeight;
@property (weak, nonatomic) IBOutlet NSLayoutConstraint *tableviewHeight;



@end

@implementation BTCCommonSellViewController

- (void)viewDidLoad {
    
    [super viewDidLoad];
    
    self.isSec = NO;
    
    self.fudongView.hidden = YES;
    self.topCon.constant = 15;
    self.heightCon.constant = 108;
    
    [self isTimeView];
    [self isLowestView];
    
    self.tableview.delegate = self;
    self.tableview.dataSource = self;
    [self.tableview registerClass:[UITableViewCell class] forCellReuseIdentifier:@"cell"];
    self.tableviewHeight.constant = 5*50;
    self.PaymentViewHeight.constant = 40 +5*50;
    
}

- (NSInteger)numberOfSectionsInTableView:(UITableView *)tableView {
    return 1;
}

- (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section {
    
    return 5;
}

- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath {
    UITableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:@"cell" forIndexPath:indexPath];
    cell.textLabel.text =  @"建设银行 6228********3452  王念龙";
    cell.textLabel.textAlignment = NSTextAlignmentCenter;
    return cell;
}

- (void)isLowestView {
    
    if ([self.genre isEqualToString:CoinType_Sell_NormalModel]) { //普通卖
        self.midderVIewHeight.constant = 50;
    } else { //安全卖
        self.midderVIewHeight.constant = 94;
    }
}

- (void)isTimeView {
    
    if ([self.genre isEqualToString:CoinType_Sell_NormalModel]) {
        self.timeViewHeight.constant = 0;
        self.liuyanViewTop.constant = 0;
    } else {
        self.timeViewHeight.constant = 64;
        self.liuyanViewTop.constant = 66;
    }
}


- (IBAction)qiehuanBtn:(id)sender {
    
    if (self.isSec == NO) {
        
        self.fudongView.hidden = NO;
        self.topCon.constant = 60;
        self.heightCon.constant = 148;
        
        self.isSec = YES;
    } else {
        self.fudongView.hidden = YES;
        self.topCon.constant = 15;
        self.heightCon.constant = 108;
        
        self.isSec = NO;
    }
    
}







- (void)didReceiveMemoryWarning {
    [super didReceiveMemoryWarning];
    
}



@end
